/**
 * Copyright (C)  2011  chen wei hua.
 * Permission is granted to copy, distribute and/or modify this document
 * under the terms of the GNU Free Documentation License, Version 2.0
 * or any later version published by the Free Software Foundation;
 * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
 * A copy of the license is included in the section entitled "GNU Free Documentation License".
 */
package com.javaeye.common.service;

import java.util.List;

import com.javaeye.common.dao.RoleDAO;
import com.javaeye.common.dto.Role;

public class RoleService implements IRoleService {
	
	private RoleDAO roleDao;
	
	public void setRoleDao(RoleDAO roleDao) {
		this.roleDao = roleDao;
	}

	public List<Role> getRoles() {
		List<Role> result = roleDao.getRoles();
		return result;
	}
	
	public void saveRole(Role role) {
		roleDao.saveRole(role);
	}
	
	public boolean removeRole(int roleId) {
		roleDao.removeRole(roleId);
		return true;
	}
	
	public Role getRole(int roleId) {
		Role role = roleDao.getRole(roleId);
		return role;
	}
}
